//
//  ViewController.m
//  search搜索标签
//
//  Created by 涂永江 on 2017/8/28.
//  Copyright © 2017年 涂永江. All rights reserved.
//

#import "ViewController.h"
#import "SearchShowView.h"

@interface ViewController ()<SearchShowViewDateSource>
@property (nonatomic,strong) NSArray *data;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    _data = [NSMutableArray arrayWithArray:@[@"测试数据",@"云标签",@"历史记录",@"测试",@"妈妈说标题要长",@"机智的手哥"]];
  
    NSLog('');
    SearchShowView *searchView = [[SearchShowView alloc] initWithFrame:self.view.bounds];
    
    searchView.dateSource = self;
    
    [self.view addSubview:searchView];

    [searchView reloadData];
}

// 提供组数
- (NSInteger)numberOfSectionsInSearchShowView:(SearchShowView *)searchShowView
{
    return 1;
}

// 提供网格单元的数量
- (NSInteger)numberOfItemsInHorizontalSearchShowView:(SearchShowView *)searchShowView
{
    return _data.count;
}

// 提供网格单元标题
- (NSString *)horizontalSearchShowView:(SearchShowView *)searchShowView titleForItemAtIndex:(NSInteger)idx
{
    return _data[idx];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
